refactor(BA-6943): authorize scheduling-history scoped searches via RBAC#12974
Draft
jopemachine wants to merge 1 commit into
Draft
refactor(BA-6943): authorize scheduling-history scoped searches via RBAC#12974jopemachine wants to merge 1 commit into
jopemachine wants to merge 1 commit into
Conversation
jopemachine
force-pushed
the
feat/BA-6943-scoped-search-rbac
branch
2 times, most recently
from
July 20, 2026 07:22
300fe27 to
18d537a
Compare
Rebased onto main, which rebuilt the scheduling read path and already RBAC-authorizes the kernel/session/route scoped searches. Net changes: - Route the deployment scoped search through ScopeActionProcessor with the RBAC scope validator, matching session/kernel/route. - Type the scoped-search action targets by id (SessionId, DeploymentID, ReplicaID) rather than pre-built SearchScope objects. - Add session/deployment/route history read permissions, mirrored from each scope entity's existing READ grant; migration re-parented onto the current head. - Register SESSION_HISTORY / DEPLOYMENT_HISTORY / ROUTE_HISTORY RBAC element types. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jopemachine
force-pushed
the
feat/BA-6943-scoped-search-rbac
branch
from
July 24, 2026 04:19
bcb1864 to
9a85ac0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #12971 (BA-6943)
Summary
SearchableActionTargetmapping to both an RBAC element (SESSION/MODEL_DEPLOYMENT/ROUTING) and a search scope; the actions extendBaseBulkActionand the processors run throughBulkActionProcessorwithvalidators.rbac.bulk.SearchScopebuilt straight from request input and exposed no RBAC element, sovalidators.rbacnever ran — the repository turned the scope into aWHEREclause andexistence_checksonly confirmed the entity existed, not that the caller could read it. The routes papered over this by requiring super-admin, which made the scoped variants useless to the users who actually own the entities.auth_required. With authorization enforced on the action path, a user can read the scheduling history of a session/deployment/route they hold, and getsPermissionDeniedErrorfor one they do not — not a silently empty page. The unscoped admin searches staysuperadmin_required.admin_prefix, which no longer describes them.SchedulingHistoryProcessors.__init__already acceptedActionValidatorswithout using it; that was the wiring point. The repository now takesSequence[SearchScope]so multiple authorized targets can be matched.Independent of the BA-6889..BA-6893 kernel stack — branched from
main, touches only the three pre-existing entities.search_kernel_scoped_historyis deliberately untouched here (converted in #12869); doing it on both branches would conflict.Test plan
pants checkclean (5251 source files)pants lintclean oversrc/ai/backend/::andtests/unit/manager/::element_refs()BulkActionRBACValidatorshort-circuits for super admins, so the unscoped admin paths are unaffected🤖 Generated with Claude Code
📚 Documentation preview 📚: https://sorna--12974.org.readthedocs.build/en/12974/
📚 Documentation preview 📚: https://sorna-ko--12974.org.readthedocs.build/ko/12974/